The present invention relates to a method and apparatus for processing pixels of a digital image and, in particular, to the rendering of grey-scale graphic objects into raster pixel images.
Most object based graphics systems utilise a frame store or page buffer to hold a pixel-based image of the page or screen. Typically, the outlines of the graphic objects are calculated, filled and written into the frame store. For two-dimensional graphics, objects which appear in front of other objects are simply written into the frame store after the background objects, thereby replacing the background on a pixel-by-pixel basis. This is commonly known in the art as the xe2x80x9cPainter""s algorithmxe2x80x9d. Objects are considered in priority order, from the rearmost object to the foremost object, and, typically, each object is rasterised in scan line order and pixels are written to the frame store in sequential runs along each scan line.
There are essentially two problems with this technique. The first is that it requires fast random access to all the pixels in the frame store. This is because each new object considered could affect any pixel in the frame-store. For this reason, the frame store is normally kept in semiconductor random access memory (RAM). For high resolution color printers the amount of RAM required is very large, typically in excess of 100 MBytes, which is costly and difficult to operate at high speed. The second problem is that many pixels which are painted (rendered), are over-painted (re-rendered) by later objects. Painting the pixels with the earlier objects was a waste of time.
One method for overcoming the large frame-store problem is the use of xe2x80x9cbandingxe2x80x9d. When banding is used, only part of the frame-store exists in memory at any one time. All of the objects to be drawn are retained in a xe2x80x9cdisplay listxe2x80x9d. The whole image is rendered as above, but pixel painting (rendering) operations that try to paint (render) outside the fraction of the frame-store which exists are xe2x80x9cclippedxe2x80x9d out. After all the objects have been drawn, the fractional part of the frame-store is sent to the printer (or some other location) and another fraction of the frame-store is selected and the process repeated. There are penalties with this technique. For example, the objects being drawn must be considered and re-considered many timesxe2x80x94once for each band. As the number of bands increases, so too does the repetitious examination of objects requiring rendering. The technique of banding does not solve the problem of the cost of over-painting.
Some other graphic systems consider the image in scan line order. Again, all the objects to be drawn are retained in a display list. On each scan line the objects which intersect that scan line are then considered in priority order and for each object, spans of pixels between object edge intersection points are set in a line store. This technique also overcomes the large frame store problem, but still suffers from the over-paint problem.
There are other techniques which overcome both the large frame-store problem and the over-painting problem. In one such technique, each scan line is produced in turn. Again, all the objects to be drawn are retained in a display list. On each scan line, the edges of objects which intersect that scan line are held in order of increasing coordinate of intersection with the scan line. These points of intersection, or edge crossings, are considered in turn and used to toggle an array of active flags. There is one active flag for each object priority which is of interest on the scan line. Between each pair of edges considered, the color data for each pixel which lies between the first edge and the next edge is generated by using a priority encoder on the active flags to determine which priority is topmost, and using the color associated with that priority for the pixels of the span between the two edges. In preparation for the next scan line, the coordinate of intersection of each edge is updated in accordance with the nature of each edge. Adjacent edges which become mis-sorted as a result of this update are swapped. New edges are also merged into the list of edges.
This technique has the significant advantages that there is no frame store or line store, there is no over painting, and the object priorities are dealt with in constant order time, rather than order N time (where N is the number of priorities).
The output of such graphic system normally consists of a bus (24 or 32-bit wide) to carry pixel color data that toggles at every clock cycle or so. Accompanying the pixel data bus are some control signals that signify pixel""s attributes and properties. The pixel color data is typically made of its color components, that is Red, Green, Blue, and with or without opacity channels (or Cyan, Magenta, Yellow and Black channels).
In the case of grey scale rendering, the systems either have a narrower data path (that is 8-bit wide) or make use of one of the four available channels in the color graphic system.
It is an object of the present invention to substantially overcome, or at least ameliorate, one or more disadvantages of existing arrangements.
According to one aspect of the invention, there is provided a method of processing pixels of a digital image, said method comprising the steps of: configuring an image processor to operate in a first processing mode or a second processing mode, said image processor having a plurality of color output channels; processing one or more color pixels each having one or more pixel color components and outputting one said color pixel at a time by outputting said one or more pixel color components on respective one or more said color output channels when said image processor is configured in said first processing mode; and processing one or more pixels each having one pixel color component and outputting one or more said pixels at a time by outputting said one or more pixels simultaneously on respective said color output channels when said image processor is configured in said second processing mode.
According to another aspect of the invention, there is provided apparatus for processing pixels of a digital image, said apparatus comprising: an image processor for processing pixels of a digital image, said image processor comprising a plurality of color output channels; and a controller for configuring the image processor to operate in a first processing mode or a second processing mode; said image processor processes one or more color pixels each having one or more pixel color components and outputting one said color pixel at a time by outputting said one or more pixel color components on respective one or more said color output channels when said image processor is configured in said first processing mode; and said image processor processes one or more pixels each having one pixel color component and outputting one or more said pixels at a time by outputting said one or more pixels simultaneously on respective said color output channels when said image processor is configured in said second processing mode.
According to another aspect of the invention, there is provided a method of processing pixels of a digital image, said method comprising the steps of: configuring an image processor to operate in a first operating mode or a second operating mode, said image processor having a plurality of color output channels; generating, during said first operating mode, one or more color pixels having one or more pixel color components; outputting, during said first operating mode, said generated color pixels one at a time by outputting said one or more pixel color components of each generated pixel on corresponding said color output channels; generating, during said second operating mode, one or more fill commands each comprising a parameter indicating the number of consecutive pixel locations in raster order to which the fill command applies, wherein said number can vary from one to a maximum number equal to the number of said color output channels; generating, during said second operating mode, one or more pixels in response to one or more said fill commands for one or more said pixel locations, wherein the number of pixels generated is dependent upon the number of fill commands and said parameter of the fill commands and wherein said generated pixels having one pixel color component; outputting, during said second operating mode, one or more said pixels at a time by outputting one or more said pixels simultaneously on one or more said color output channels.
According to another aspect of the invention, there is provided apparatus for processing pixels of a digital image, said apparatus comprising: a host processor for configuring an image processor to operate in a first operating mode or a second operating mode, said image processor having a plurality of color output channels; said image processor comprising: a fill module for generating, during said first operating mode, one or more color pixels having one or more pixel color components and outputting said generated pixels one at a time by outputting said one or more pixel color components of each generated pixel on corresponding said color output channels; a module for generating, during said second operating mode, one or more fill commands each comprising a parameter indicating the number of consecutive pixel locations in raster order to which the fill command applies, wherein said number can vary from one to a maximum number equal to the number of said color output channels; and said fill module generating, during said second operating mode, one or more pixels in response to one or more said fill commands for one or more said pixel locations, and simultaneously outputting one or more said pixels on corresponding one or more said color output channels, wherein the number of pixels generated is dependent upon the number of fill commands and said parameter of the fill commands and wherein said generated pixels each having one pixel color component.
According to another aspect of the invention, there is provided a method of processing pixels of a digital image, said method comprising the steps of: configuring an image processor to operate in a first operating mode or a second operating mode, said image processor having a plurality of color output channels; generating, during said first operating mode, one or more fill commands; generating, during said first operating mode, one or more color pixels in response to one or more respective said fill commands for a pixel location, wherein said generated color pixels having one or more pixel color components; outputting, during said first operating mode, said generated pixels one at a time by outputting said one or more pixel color components of each generated pixel on corresponding said color output channels; generating, during said second operating mode, one or more fill commands each comprising a parameter indicating the number of consecutive pixel locations in raster order to which the fill command applies, wherein said number can vary from one to a maximum number equal to the number of said color output channels; generating, during said second operating mode, one or more pixels in response to one or more said fill commands for one or more said pixel locations, wherein the number of pixels generated is dependent upon the number of fill commands and said parameter of the fill commands and wherein said generated pixels each having one pixel color component; outputting, during said second operating mode, one or more said pixels simultaneously on corresponding one or more said color output channels.
According to another aspect of the invention, there is provided apparatus for processing pixels of a digital image, said apparatus comprising: a host processor for configuring an image processor to operate in a first operating mode or a second operating mode, said image processor comprising: a priority module for generating, during said first operating mode, one or more fill commands for corresponding pixel locations; a fill module generating, during said first operating mode, one or more color pixels in response to one or more respective said fill commands for a said pixel location, and outputting said generated color pixels one at a time by outputting one or more pixel color components of each generated color pixel on corresponding color output channels; the priority module generating, during said second operating mode, one or more fill commands each comprising a parameter indicating the number of consecutive pixel locations in raster order to which the fill command applies, wherein said number can vary from one to a maximum number equal to the number of said color output channels; the fill module generating, during said second operating mode, one or more pixels in response to one or more said fill commands for one or more said pixel locations, and simultaneously outputting one or more said generated pixels on corresponding one or more said color output channels, wherein the number of pixels generated is dependent upon the number of fill commands and said parameter of the fill.
According to another aspect of the invention, there is provided a method of generating commands for producing pixels of a digital image, said method comprising the steps of: generating, during said first operating mode, one or more fill commands for a pixel location; generating, during said second operating mode, one or more fill commands each comprising a parameter indicating the number of consecutive pixel locations in raster order to which the fill command applies, wherein said number can vary from one to a maximum number equal to the number of said color output channels;
According to another aspect of the invention, there is provided apparatus for generating commands for producing pixels of a digital image, said apparatus comprising: a generator for generating, during said first operating mode, one or more fill commands for a pixel location and for generating, during said second operating mode, one or more fill commands each comprising a parameter indicating the number of consecutive pixel locations in raster order to which the fill command applies, wherein said number can vary from one to a maximum number equal to the number of said color output channels.
According to another aspect of the invention, there is provided a computer readable medium comprising a computer program for generating commands for producing pixels of a digital image, said computer program comprising: code for generating, during said first operating mode, one or more fill commands for a pixel location and for generating, during said second operating mode, one or more fill commands each comprising a parameter indicating the number of consecutive pixel locations in raster order to which the fill command applies, wherein said number can vary from one to a maximum number equal to the number of said color output channels.